(function(){	
	/*
		Ctor: translator.encoding.shift
		
		The implementation of shift encoder/decoder 
	*/
	translator.encodings.shift = mapo.ctor(function(){
	}, translator.encodings.base);
	var p = translator.encodings.shift.prototype;
	p.prefix = "[shift";
	p.subfix = "shift]";
	p.name = "shift";
	p.encode = function(msg){
		var chars = msg.split("");
		var i = chars.length;
		while(i--){
			chars[i] = String.fromCharCode(chars[i].charCodeAt() + 300000);
		}
		var encoded = chars.join("");
		return this.prefix + encoded+ this.subfix;
	};
	p.decode = function(msg){
		var ret = msg.trim().substr(this.prefix.length, msg.length - this.prefix.length);
		ret = ret.substr(0, ret.length - this.subfix.length);
		
		var chars = ret.split("");
		var i = chars.length;
		while(i--){
			chars[i] = String.fromCharCode(chars[i].charCodeAt() - 300000);
		}
		ret = chars.join("");
		
		return ret;
	};
	
	new translator.encodings.shift();
})();